home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows Expert
/
Windows Expert.iso
/
windownt
/
cshx86.zip
/
SAMPLES
/
FACTOR.CSH
< prev
next >
Wrap
Text File
|
1993-04-14
|
304b
|
17 lines
# Calculate the prime factors of an integer.
# Copyright (c) 1989 by Hamilton Laboratories. All rights reserved.
proc factor(n)
if (n > 3) then
for i = 2 to floor(sqrt(n)) do
if (n % i == 0) then
echo $i
return factor(n//i)
end
end
end
return n
end
factor $argv